package com.lvshi0797.cms.dto;

import org.apache.commons.lang.StringUtils;

import com.lvshi0797.cms.entities.FDisabledInfo;
import com.lvshi0797.cms.entities.FMember;

public class MemberDto {
	  
	private String memberId;
	private String isHuzhu;
	private String username;
	private String gender;
	private String education;
	private String identityCard;
	private String workstatus;
	private String isInDibao;
	private String isInYibao;
	private String isInYanglao;
	private String isDisable;
	private String memo;
	
	private FMember member;
	
	private String disaId;
	private String disableCard;
	private String disaHow;
	private String disaType;
	private String disaLevel;
	private String marryStatus;
	private String hasWorkable;
	
	private FDisabledInfo disabledInfo;
	private String baseInfoId;
	private String item;

	public String getMemberId() {
		return memberId;
	}

	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}
	
	

	public String getBaseInfoId() {
		return baseInfoId;
	}

	public void setBaseInfoId(String baseInfoId) {
		this.baseInfoId = baseInfoId;
	}

	public String getDisaId() {
		return disaId;
	}

	public void setDisaId(String disaId) {
		this.disaId = disaId;
	}
	

	public String getItem() {
		return item;
	}

	public void setItem(String item) {
		this.item = item;
	}

	public String getIsHuzhu() {
		return isHuzhu;
	}

	public void setIsHuzhu(String isHuzhu) {
		this.isHuzhu = isHuzhu;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	public String getIdentityCard() {
		return identityCard;
	}

	public void setIdentityCard(String identityCard) {
		this.identityCard = identityCard;
	}

	public String getWorkstatus() {
		return workstatus;
	}

	public void setWorkstatus(String workstatus) {
		this.workstatus = workstatus;
	}

	public String getIsInDibao() {
		return isInDibao;
	}

	public void setIsInDibao(String isInDibao) {
		this.isInDibao = isInDibao;
	}

	public String getIsInYibao() {
		return isInYibao;
	}

	public void setIsInYibao(String isInYibao) {
		this.isInYibao = isInYibao;
	}

	public String getIsInYanglao() {
		return isInYanglao;
	}

	public void setIsInYanglao(String isInYanglao) {
		this.isInYanglao = isInYanglao;
	}

	public String getIsDisable() {
		return isDisable;
	}

	public void setIsDisable(String isDisable) {
		this.isDisable = isDisable;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public FMember getMember() {
		this.member = new FMember(this.username, this.gender, this.education, this.identityCard, this.workstatus, StringToInt(isHuzhu), StringToInt(isInDibao), StringToInt(isInYibao), StringToInt(isInYanglao), StringToInt(isDisable), this.memo);
		this.disabledInfo = new FDisabledInfo(disableCard, disaHow, disaType, disaLevel, marryStatus, hasWorkable);
		this.disabledInfo.setId(StringToInt(disaId));
		this.member.setId(StringToInt(memberId));
		this.member.setDisabledInfo(disabledInfo);
		return member;
	}

	public void setMember(FMember member) {
		FDisabledInfo disabledInfo2 = member.getDisabledInfo();
		if(disabledInfo2!=null){
			this.setDisabledInfo(disabledInfo2);
		}
		this.memberId = member.getId()+"";
		this.isHuzhu = member.getIsHuzhu()+"" ;
		this.username = member.getUsername();
		this.gender = member.getGender();
		this.education = member.getEducation();
		this.identityCard = member.getIdentityCard();
		this.workstatus = member.getWorkstatus();
		this.isInDibao = member.getIsInDibao()+"";
		this.isInYibao = member.getIsInYibao()+"";
		this.isInYanglao = member.getIsInYanglao()+"";
		this.isDisable = member.getIsDisable()+"";
		this.memo = member.getMemo();
		this.member = member;
	}

	public String getDisableCard() {
		return disableCard;
	}

	public void setDisableCard(String disableCard) {
		this.disableCard = disableCard;
	}

	public String getDisaHow() {
		return disaHow;
	}

	public void setDisaHow(String disaHow) {
		this.disaHow = disaHow;
	}

	public String getDisaType() {
		return disaType;
	}

	public void setDisaType(String disaType) {
		this.disaType = disaType;
	}

	public String getDisaLevel() {
		return disaLevel;
	}

	public void setDisaLevel(String disaLevel) {
		this.disaLevel = disaLevel;
	}

	public String getMarryStatus() {
		return marryStatus;
	}

	public void setMarryStatus(String marryStatus) {
		this.marryStatus = marryStatus;
	}

	public String getHasWorkable() {
		return hasWorkable;
	}

	public void setHasWorkable(String hasWorkable) {
		this.hasWorkable = hasWorkable;
	}

	public FDisabledInfo getDisabledInfo() {
		this.disabledInfo = new FDisabledInfo(disableCard, disaHow, disaType, disaLevel, marryStatus, hasWorkable);
		this.disabledInfo.setId(StringToInt(disaId));
		return disabledInfo;
	}

	public void setDisabledInfo(FDisabledInfo disabledInfo) {
		this.disaId = disabledInfo.getId()+"";
		this.disableCard = disabledInfo.getDisableCard();
		this.disaHow = disabledInfo.getDisaHow();
		this.disaType = disabledInfo.getDisaType();
		this.disaLevel = disabledInfo.getDisaLevel();
		this.marryStatus = disabledInfo.getMarryStatus();
		this.hasWorkable = disabledInfo.getHasWorkable();
		this.disabledInfo = disabledInfo;
	}
	private int StringToInt(String s){
		if(StringUtils.isNotBlank(s)){
			return Integer.parseInt(s);
		}else{
			return 0;
		}
	}
	
	
	
	
	
}
